package com.entity;


import cn.hutool.core.date.DatePattern;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;


/**
 * ${comments}
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-12-05 14:43:15
 */
@Entity
@Data
public class Artical implements Serializable{
	private static final long serialVersionUID = 739668778715426461L;
	@Id
	@ApiModelProperty("主键")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 标题
	 */
	@ApiModelProperty("标题")
	@Column(columnDefinition = "text ")
	private String title;
	/**
	 * 描述
	 */
	@ApiModelProperty("描述")
	@Column(columnDefinition = "text ")
	private String descre;

	/**
	 * 创建人ID
	 */
	private String userId;
	private String crName;
    @ApiModelProperty("图片集" )
	@Column(columnDefinition = "text ")
    private String imgs;
    @ApiModelProperty("预览图")
	@Column(columnDefinition = "text ")
    private String preImg;

	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@Column(columnDefinition = "datetime")
	private Date crDate;
	@TableField(update = "getdate()")
	@ApiModelProperty("修改时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@Column(columnDefinition = "datetime")
	private Date moDate;
	@Column(columnDefinition = "varchar(10)")
	private String isAvailable;
	@ApiModelProperty("是否发布")
	@Column(columnDefinition = "varchar(10)")
	private String isSend;
	@ApiModelProperty("资源链接")
	@Column(columnDefinition = "text")
	private String resourceLink;
	@ApiModelProperty("资源文件")
	@Column(columnDefinition = "text")
	private String resourceFile;
	@ApiModelProperty("是否自建")
	@Column(columnDefinition = "varchar(10)")
	private String isSelf;
	@ApiModelProperty("来源")
	@Column(columnDefinition = "varchar(30)")
	private String origin;
	@ApiModelProperty("其他网站的预览图")
	@Column(columnDefinition = "text")
	private String otherPre;
	@ApiModelProperty("其他网站的资源文件")
	@Column(columnDefinition = "text")
	private String otherResourceFile;

	public static final String YES = "yes";
	private static final String NO = "no";
	/**
	 * 自建
	 */
	public static final String SELF = "self";
	/**
	 * 采集
	 */
	public static final String COLLECT  = "collect";




}
